<#include "/common/head.html"/>

 <div class="easyui-panel addPage" data-options="fit:true,border:false">
    <form id="ff" method="post" class="easyui-form" data-options="novalidate:true">
        <table class="table1">
            <tr>
           		<th><span>作业名称：</span></th>
               	<td>
            		<input class="easyui-textbox"  data-options="required:true" type="text" name="job_name"></input>
           		</td>
           		<th><span>作业执行类：</span></th>
               	<td>
            		<input class="easyui-textbox" type="text" name="job_class"></input>
           		</td>
            </tr>        	
            <tr>
           		<th><span>分组：</span></th>
               	<td>
            		<input class="easyui-textbox" type="text" name="job_group"></input>
           		</td>               	
           		<th><span>周期任务时间规则：</span></th>
               	<td>
            		<input class="easyui-textbox" type="text" name="job_cron"></input>
           		</td>
               	
            </tr>
            <tr>
           		<th><span>作业类型：</span></th>
               	<td>
            		<input class="easyui-textbox" type="text" name="job_type"></input>
           		</td>               	
           		<th><span>执行时间：</span></th>
               	<td>
            		<input class="easyui-datebox" type="text" name="start_time"></input>
           		</td>               
            </tr>
            <tr>
           		<th><span>运行状态：</span></th>                          	
           		
               	<td>
            		<input class="easyui-textbox" type="text" name="run_status"></input>
           		</td>  
           		<th><span>任务状态：</span></th>     
           			<td>
            		<input class="easyui-textarea" type="text" name="job_desc"></input>
           		</td>
           		        
            </tr>
        </table>
    </form>
</div>
<script>
$(function() {
top.window.subPage.save = save;
function save(successFunc) {
	if($("#ff").form('enableValidation').form('validate')) {
		$.post("${basePath}/job/add", getParam(), function(data) {
			if(successFunc) {
				successFunc();
			}
			top.window.closeWindow();
			top.window.subPage.loadCurrDatagrid();
		});
	}
}
function getParam() {
	var param = {
   	    "model.job_name": $(":input[name='job_name']").val(), 
  	    "model.job_class": $(":input[name='job_class']").val(), 
  	    "model.job_group": $(":input[name='job_group']").val(), 
  	    "model.job_cron": $(":input[name='job_cron']").val(), 
   	    "model.job_type": $(":input[name='job_type']").val(),
   		"model.start_time": $(":input[name='start_time']").val(),
   		"model.run_status": $(":input[name='run_status']").val(),
   		"model.job_desc": $(":input[name='job_desc']").val()
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}
});
</script>
<#include "/common/foot.html"/>